Skip to content

Update page/javascript-101/types.md #247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

lsoares
Copy link
Contributor

@lsoares lsoares commented Feb 18, 2013

@rmurphey
Copy link
Contributor

FWIW, ECMAScript 5 doesn't use the term "composite" to describe types. From the spec:

The ECMAScript language types are Undefined, Null, Boolean, String, Number, and Object.

See section 4.3 and section 8.

The term "primitive" refers specifically to type types Undefined, Null, Boolean, String, and Number, leaving Object as the remaining type.

@lsoares
Copy link
Contributor Author

lsoares commented Feb 18, 2013

What about the "Array" composite type considered by Microsoft?
Is it just a built in Object?

(I removed the word "in" somewhere)


Luís Soares
luissoares.com

On Mon, Feb 18, 2013 at 5:27 PM, Rebecca Murphey
notifications@github.comwrote:

FWIW, ECMAScript 5http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdfdoesn't use the term "composite" to describe types. From the spec:

The ECMAScript language types are Undefined, Null, Boolean, String,
Number, and Object.

See section 4.3 http://people.mozilla.org/%7Ejorendorff/es5.html#sec-4.3and section
8 http://people.mozilla.org/%7Ejorendorff/es5.html#sec-8.

The term "primitive" refers specifically to type types Undefined, Null,
Boolean, String, and Number, leaving Object as the remaining type.


Reply to this email directly or view it on GitHubhttps://github.com//pull/247#issuecomment-13732866.

@rmurphey
Copy link
Contributor

Strictly speaking, I don't think ECMA5 considers an Array to be a type -- it's just another kind of object.

@rwaldron
Copy link
Member

This was discussed previously, because the docs also used the term map which is incorrect. Anyway, the only acceptable term is "object", but "plain object" is useful is if you really need the distinction.

@lsoares Like @rmurphey said, in ES5 an Array is just an object. In ES6 they are categorized as "Exotic Objects" due to the special semantics of the numeric index properties and the length property.

@lsoares
Copy link
Contributor Author

lsoares commented Feb 18, 2013

ok; thanks for the clarifications :)

@lsoares
Copy link
Contributor Author

lsoares commented Feb 18, 2013

anyway... don't forget the sentence:
"Everything else is in JavaScript is considered an Object."
should be:
"Everything else in JavaScript is considered an Object."

@rwaldron
Copy link
Member

@lsoares can you update the PR to have that fix?

@ajpiano
Copy link
Member

ajpiano commented Feb 20, 2013

The "in" error was fixed in 2d71b5c, so I don't believe there's anything else to do here. Thanks!

@ajpiano ajpiano closed this Feb 20, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants